package cn.edu.nju.software.action.category;

import cn.edu.nju.software.bean.storage.Category;
import cn.edu.nju.software.service.intf.CategoryService;

import com.opensymphony.xwork2.ActionSupport;

@SuppressWarnings("serial")
public class AddCategoryAction extends ActionSupport {
	
	private Category category;
	private CategoryService categoryService;
	
	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public void setCategoryService(CategoryService categoryService) {
		this.categoryService = categoryService;
	}
	
	@Override
	public String execute() throws Exception {
		categoryService.addCategory(category);
		return SUCCESS;
	}
	
}
